package listbyorder.access201_300.test344;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/7/1 21:15
 */
public class Solution1 {

    // 反转字符串
    public void reverseString(char[] s) {
        int n = s.length;
        for (int i = 0; i < n / 2; i++) {
            swap(s, i, n - 1 - i);
        }
    }

    public void swap(char[] s, int i, int j){
        char temp = s[i];
        s[i] = s[j];
        s[j] = temp;
    }
}
